
    /********************************************************/
    /*                                                      */
    /*                                                      */
    /*         Copyright (C), 2001  SEIKO EPSON Corp.       */
    /*         ALL RIGHTS RESERVED                          */
    /*                                                      */
    /*                                                      */
    /*  file name : setjmp.c                                */
    /*                                                      */
    /*  Revision history                                    */
    /*    2001/08/09    first release       T.Tazaki        */
    /*    2001/08/21    bug fix             T.Tazaki        */
    /*    2001/11/21    chage to GNU33(LInux) T.Tazaki      */
    /*                                                      */
    /********************************************************/

#ifdef      UNIX
#include    "stdlib.h"
#include    "setjmp.h"
#else
#include    <stdlib.h>
#include    <setjmp.h>
#endif

/* int setjmp(jmp_buf *JmpBuf) 2001.08.21 */
int setjmp(jmp_buf JmpBuf)
{
	asm("	ld.w	%r7,%psr");
	asm("	ld.w	%r8,%sp");
	asm("	ld.w	%r9,%alr");
	asm("	ld.w	%r10,%ahr");
	asm("	ld.w	%r11,[%sp+0x00]");	/* return address */
	asm("	ld.w	[%r6]+,%r0");
	asm("	ld.w	[%r6]+,%r1");
	asm("	ld.w	[%r6]+,%r2");
	asm("	ld.w	[%r6]+,%r3");
	asm("	ld.w	[%r6]+,%r7");
	asm("	ld.w	[%r6]+,%r8");
	asm("	ld.w	[%r6]+,%r9");
	asm("	ld.w	[%r6]+,%r10");
	asm("	ld.w	[%r6]+,%r11");
	return 0;
}